﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommandLine;
using Imgur.Net;

namespace GurLoader.CommandLineOptions
{
    [Verb("SendImage", HelpText = "Send a single image to Imgur, optionally with metadata.")]
    public class SendImageOptions : ICommandLineOptions
    {
        [Option('f', "file", Required = true, HelpText = "Path of the file to be sent.")]
        public string File { get; set; }

        [Option('t', "title", Required = false, HelpText = "Title to use for the image.")]
        public string Title { get; set; }

        [Option('d', "description", Required = false, HelpText = "Description of the image.")]
        public string Description { get; set; }

        [Option('r', "registereduser", Required = false, HelpText = "Use a registered Imgur account to upload content. If missing data will be sent anonymously.")]
        public bool RegisteredUserAccount { get; set; }

        public Command CommandAction
        {
            get { return Command.SendImage; }
        }

        public void Validate()
        {
            if ( string.IsNullOrEmpty(File) )
                throw new Exception("File not specified.");
        }
    }
}
